// File:    Agencia.cs
// Author:  Lucas Bittencourt
// Created: quarta-feira, 16 de novembro de 2011 18:32:47
// Purpose: Definition of Class Agencia

using System;
using System.Text;

namespace DA_OOMModel
{
   public class Agencia
   {
       private int agcIdAgencia;
       private string agcNuAgencia;
       private string agcNuDigitoAgencia;
       private string agcNmAgencia;
       private string agcNuCnpj;

       private Iesi.Collections.ISet contaBancaria;
      
      /// <summary>
      /// Property for collection of ContaBancaria
      /// </summary>
      /// <pdGenerated>Default opposite class collection property</pdGenerated>
      public virtual Iesi.Collections.ISet ContaBancaria
      {
         get
         {
            return contaBancaria;
         }
         set
         {
            this.contaBancaria = value;         
         }
      }
      private Banco banco;
      
      /// <summary>
      /// Property for Banco
      /// </summary>
      /// <pdGenerated>Default opposite class property</pdGenerated>
      public virtual Banco Banco
      {
         get
         {
            return banco;
         }
         set
         {
               this.banco = value;
         }
      }
   
      /// <summary>
      /// Get value of property AgcIdAgencia.
      /// </summary>
      public virtual int AgcIdAgencia
      {
         get
         {
            return agcIdAgencia;
         }
         set
         {
            if (this.agcIdAgencia != value)
               this.agcIdAgencia = value;
         }
      }
      
      /// <summary>
      /// Get value of property AgcNuAgencia.
      /// </summary>
      public virtual string AgcNuAgencia
      {
         get
         {
            return agcNuAgencia;
         }
         set
         {
            if (this.agcNuAgencia != value)
               this.agcNuAgencia = value;
         }
      }
      
      /// <summary>
      /// Get value of property AgcNuDigitoAgencia.
      /// </summary>
      public virtual string AgcNuDigitoAgencia
      {
         get
         {
            return agcNuDigitoAgencia;
         }
         set
         {
            if (this.agcNuDigitoAgencia != value)
               this.agcNuDigitoAgencia = value;
         }
      }
      
      /// <summary>
      /// Get value of property AgcNmAgencia.
      /// </summary>
      public virtual string AgcNmAgencia
      {
         get
         {
            return agcNmAgencia;
         }
         set
         {
            if (this.agcNmAgencia != value)
               this.agcNmAgencia = value;
         }
      }
      
      /// <summary>
      /// Get value of property AgcNuCnpj.
      /// </summary>
      public virtual string AgcNuCnpj
      {
         get
         {
            return agcNuCnpj;
         }
         set
         {
            if (this.agcNuCnpj != value)
               this.agcNuCnpj = value;
         }
      }
   
      /// <summary>
      /// Get and set primary key class
      /// </summary>
      public virtual AgenciaPK AgenciaPK
      {
         get 
         {
            return new AgenciaPK(agcIdAgencia);
         }
         set
         {
            if (value != null)
            {
               this.agcIdAgencia = value.AgcIdAgencia;
            }
         }
      }
   
      /// <summary>
      /// Get hash code
      /// </summary>
      /// <pdGenerated>Get hash code</pdGenerated>
      public override int GetHashCode()
      {
         int _hashCode = 0;
         _hashCode = 29 * AgenciaPK.GetHashCode();
         if (this.agcNuAgencia != null) 
            _hashCode += 29 * agcNuAgencia.GetHashCode();
      
         if (this.agcNuDigitoAgencia != null) 
            _hashCode += 29 * agcNuDigitoAgencia.GetHashCode();
      
         if (this.agcNmAgencia != null) 
            _hashCode += 29 * agcNmAgencia.GetHashCode();
      
         if (this.agcNuCnpj != null) 
            _hashCode += 29 * agcNuCnpj.GetHashCode();
         return _hashCode;
      }
   
      /// <summary>
      /// Test if two objects are equal
      /// </summary>
      /// <param name="object">Object to compare</param>
      /// <pdGenerated>Test if two objects are equal</pdGenerated>
      public override bool Equals(object obj)
      {
         if (obj == null)
            return false;
         Agencia cast = obj as Agencia;
         if (!(obj is Agencia))
            return false;
         if (!this.AgenciaPK.Equals(cast.AgenciaPK))
            return false;
         if (this.agcIdAgencia != cast.AgcIdAgencia)
            return false;
         if (String.Equals(this.agcNuAgencia, cast.AgcNuAgencia) == false)
            return false;
      
         if (String.Equals(this.agcNuDigitoAgencia, cast.AgcNuDigitoAgencia) == false)
            return false;
      
         if (String.Equals(this.agcNmAgencia, cast.AgcNmAgencia) == false)
            return false;
      
         if (String.Equals(this.agcNuCnpj, cast.AgcNuCnpj) == false)
            return false;
      
      
         return true;
      }
   
      /// <summary>
      /// Get object in string format
      /// </summary>
      /// <pdGenerated>Get object in string format</pdGenerated>
      public override string ToString()
      {
         StringBuilder ret = new StringBuilder();
         ret.Append( "Agencia: " );
         ret.Append( "AgcIdAgencia='" + agcIdAgencia.ToString() + "'");
         if (agcNuAgencia != null)
            ret.Append( "AgcNuAgencia='" + agcNuAgencia.ToString() + "'");
         if (agcNuDigitoAgencia != null)
            ret.Append( "AgcNuDigitoAgencia='" + agcNuDigitoAgencia.ToString() + "'");
         if (agcNmAgencia != null)
            ret.Append( "AgcNmAgencia='" + agcNmAgencia.ToString() + "'");
         if (agcNuCnpj != null)
            ret.Append( "AgcNuCnpj='" + agcNuCnpj.ToString() + "'");
         return ret.ToString();
      }
   
   }
}